import 'dart:convert' show json;

class SongCi {

  int code;
  String msg;
  List<songciuser> newslist;

  SongCi.fromParams({this.code, this.msg, this.newslist});

  factory SongCi(jsonStr) => jsonStr == null ? null : jsonStr is String ? new SongCi.fromJson(json.decode(jsonStr)) : new SongCi.fromJson(jsonStr);

  SongCi.fromJson(jsonRes) {
    code = jsonRes['code'];
    msg = jsonRes['msg'];
    newslist = jsonRes['newslist'] == null ? null : [];

    for (var newslistItem in newslist == null ? [] : jsonRes['newslist']){
      newslist.add(newslistItem == null ? null : new songciuser.fromJson(newslistItem));
    }
  }

  @override
  String toString() {
    return '{"code": $code,"msg": ${msg != null?'${json.encode(msg)}':'null'},"newslist": $newslist}';
  }
}

class songciuser {

  String author;
  String content;
  String tags;
  String title;
  String yiwen;

  songciuser.fromParams({this.author, this.content, this.tags, this.title, this.yiwen});

  songciuser.fromJson(jsonRes) {
    author = jsonRes['author'];
    content = jsonRes['content'];
    tags = jsonRes['tags'];
    title = jsonRes['title'];
    yiwen = jsonRes['yiwen'];
  }

  @override
  String toString() {
    return '{"author": ${author != null?'${json.encode(author)}':'null'},"content": ${content != null?'${json.encode(content)}':'null'},"tags": ${tags != null?'${json.encode(tags)}':'null'},"title": ${title != null?'${json.encode(title)}':'null'},"yiwen": ${yiwen != null?'${json.encode(yiwen)}':'null'}}';
  }
}

